﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DAL;
using IChessEngine;
using ChessEngine;

namespace TestingDAO
{
    class Program
    {
        [STAThread]
        static void Main(string[] args)
        {
            Console.WriteLine(DateTime.Now);
            Console.ReadKey();
            OpenFileDialog dlg = new OpenFileDialog();
            dlg.ShowDialog();
            ChsXmlGameEditDAO dao = new ChsXmlGameEditDAO(dlg.FileName);
            List<IChsGameInfo> games = dao.GetGames();
            IChsGame game = dao.GetGame(new Guid("2b42f1b7-d34f-41b8-83d8-d60aac1412c2"));
            game.BlackPlayer = "Taimanov";
            dao.SaveGame(game);
            game = ChsFactory.CreateGame(Guid.NewGuid(), "Kasparov", "Petrosian", DateTime.Now);
            dao.SaveGame(game);
            dao.Save();
        }
    }
}
